package cn.com.hatech.blog.common.constant;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @projectName: hatech-blog
 * @package: cn.com.hatech.blog.common.constant
 * @className: WebConst
 * @author: xuruikai
 * @description: 网页基本信息相关枚举
 * @date: 2020/1/11 14:27
 * @version: 1.0
 */
@Component
public class WebConst {

    public static Map<String, String> initConfig = new HashMap<>();

    public static String LOGIN_SESSION_KEY = "login_user";

    public static final String USER_IN_COOKIE = "S_L_ID";

    /**
     * aes加密加盐
     */
    public static String AES_SALT = "0123456789abcdef";

    /**
     * 最大获取文章条数
     */
    public static final int MAX_POSTS = 9999;

    /**
     * 最大页码
     */
    public static final int MAX_PAGE = 100;

    /**
     * 文章最多可以输入的文字数
     */
    public static final int MAX_TEXT_COUNT = 200000;

    /**
     * 文章标题最多可以输入的文字个数
     */
    public static final int MAX_TITLE_COUNT = 200;

    /**
     * 上传文件最大1M
     */
    public static Integer MAX_FILE_SIZE = 1024 * 1048576;
    /**
     * 后台管理公共路径
     */
    public static String ADMIN_URL = "/admin";
    /**
     * 后台管理登录路径
     */
    public static String ADMIN_LOGIN_URL = "/admin/login";
    /**
     * get请求
     */
    public static String GET = "GET";

    /**
     * 存储token键
     */
    public static String TOKEN_KEY = "csrfToken";
}
